-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/dynamic library rounding #106
Conversation
Some tests are not passing anymore because of the implemented fix adding the remainder to the initial amount. Let's see how we can work this out. This problem could lead to issues in NTokenG3M for example: if we update the weights the sum might be > 1e18 and transactions on that block will revert or the pool might be vulnerable. |
src/LogNormal/LogNormalMath.sol
Outdated
@@ -22,7 +22,7 @@ function computeTradingFunction( | |||
LogNormalParams memory params | |||
) pure returns (int256) { | |||
int256 a = Gaussian.ppf(int256(rX.divWadDown(L))); | |||
int256 b = Gaussian.ppf(int256(rY.divWadDown(L.mulWadUp(params.mean)))); | |||
int256 b = Gaussian.ppf(int256(rY.divWadDown(L.mulWadDown(params.mean)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be in scope of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it in all of the other ones as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(didn't mean to approve, misclick)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a "Git issue", I merged into main
by mistake and reverted that commit but I think some branches are picking up the non-change as an actual change?
Cf https://github.com/cantinasec/review-primitive-excalibur/pull/7#discussion_r1536607090.